Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Separating client code from server code
Programming a manager is like programming any other business logic procedure, except that you write code for both sides of the server connection.
When you create a new procedure in the Section Editor, shown in Figure 7–1, you see a DB-Required toggle box in the header section that you can use to indicate whether the code you write goes into the client or server side when the procedure is compiled.
Figure 7–1: Section Editor
![]()
By default, the DB-Required toggle box is checked on. When it is on, the entire internal procedure or function you are writing compiles into only the server side .r file for the manager. If you turn it off, it goes into both the client and server files.
When you save your procedure, the AppBuilder writes these additional preprocessor definitions into your source procedure:
The first of these definitions says that if the
DB-REQUIREDpreprocessor has not already been defined, then define it to beTRUE. The other two definitions provide for a wrapper around each entry point in the file. Around every function and internal procedure definition you create, the AppBuilder puts theDB-REQUIRED-STARTandDB-REQUIRED-ENDpreprocessors that compile the entry point in or out, as shown:
If you look at the template for the client side procedure, you can see why they compile differently:
This file sets the
DB-REQUIREDflag toFALSEbefore the AppBuilder-generated statement in the main procedure has a chance to set it toTRUE. Therefore, allDB-REQUIREDblocks are left out of the compilation that winds up on the client.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |